<template>
  <!-- 评估的矢量图模块 -->
  <div class="_main">
    <div class="pg" v-if="cinvInfo">
      <div class="pg_info">
        <div class="white">
          <img :src="picDegrees" alt="" />
        </div>
        <p>抗肿瘤药物致吐风险</p>
        <div
          class="btn"
          style="background: linear-gradient(180deg, #D87BFF 0%, #5334D5 100%);"
        >
          {{ cinvInfo.risk.split(" ")[1] }}
        </div>
        <div class="btn">{{ cinvInfo.risk.split(" ")[0] }}</div>
      </div>
      <div class="pg_item">
        <van-row>
          <van-col span="4" class="img">
            <img src="@/assets/img/yuan1.png" alt="" />
          </van-col>
          <van-col span="14" class="p">
            <div>CINV个体化风险评分</div>
            <div class="tips">高危：评分≥16</div>
          </van-col>
          <van-col span="6" class="num">
            {{ cinvInfo.dranitsaris }}
          </van-col>
        </van-row>
      </div>
      <div class="pg_item">
        <div class="other">
          <img class="img" src="@/assets/img/yuan2.png" alt="" />
          <span class="p">预防止吐推荐</span>
          <span class="grey recommend">{{ cinvInfo.recommend }}</span>
        </div>
      </div>
    </div>
    <div class="empty" v-if="!cinvInfo">
      <img src="@/assets/home/empty.png" alt="" />
    </div>
  </div>
</template>

<script>
import r9 from '@/assets/img/10.svg'
import r7 from '@/assets/img/7.svg'
import r3 from '@/assets/img/3.svg'
import r1 from '@/assets/img/1.svg'
export default {
  name: '',
  props: {
    cinvInfo: {
      type: Object,
      default: () => {}
    }
  },
  data () {
    return {}
  },
  computed: {
    picDegrees () {
      const risk = this.cinvInfo.risk.split(' ')[0]
      if (risk === '高风险') return r9
      if (risk === '中风险') return r7
      if (risk === '低风险') return r3
      if (risk === '轻微风险') return r1
      return r7
    }
  },
  created () {},
  methods: {}
}
</script>

<style scoped lang="less">
// 分享评估
.empty {
  width: 100%;
  border: 1px solid rgba(112, 112, 112, 0.23137254901960783);
  background-color: #fff;
  height: 230px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.pg {
  width: 100%;
  // height: 419px;
  background: #ffffff;
  border: 1px solid rgba(112, 112, 112, 0.23137254901960783);
  border-radius: 8px;
  .pg_info {
    width: 100%;
    height: 234px;
    background: #4182ff;
    padding: 15px 50px;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid rgba(112, 112, 112, 0.23137254901960783);
    border-radius: 8px 8px 0px 0px;
    .white {
      width: 100%;
      height: 114px;
      background-color: #fff;
      img {
        width: 171px;
        height: 100%;
        margin: 10px auto;
      }
    }
    p {
      font-size: 12px;
      font-family: PingFang SC;
      font-weight: 400;
      line-height: 22px;
      color: #ffffff;
      margin: 6px 0 0 0;
    }
    .btn {
      width: 100%;
      height: 27px;
      background: #ff4053;
      border-radius: 4px;
      font-size: 12px;
      margin: 6px auto;
      font-family: PingFang SC;
      font-weight: 400;
      line-height: 22px;
      color: #ffffff;
    }
  }
  .pg_item {
    width: 94%;
    // height: 74px;
    margin: 10px auto;
    padding: 15px 6px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid rgba(112, 112, 112, 0.23137254901960783);
    border-radius: 8px;
    .other {
      position: relative;
      // background-color: red;
      padding-left: 42px;
      .img {
        position: absolute;
        left: 0;
        width: 40px;
        height: 40px;
        vertical-align: middle;
      }
      .p {
        margin-left: 10px;
        margin-right: 20px;
        font-size: 15px;
        font-family: PingFang SC;
        font-weight: 600;
        line-height: 40px;
        color: #161616;
        .tips {
          font-size: 12px;
          color: #161616;
        }
      }
      .recommend {
         text-align:center;
         color: #53CDDC;
         font-size: 20px;
      }
    }
    .num {
      font-size: 26px;
      font-family: DIN Alternate;
      font-weight: bold;
      line-height: 40px;
      color: #53cddc;
    }
    .p {
      font-size: 15px;
      font-family: PingFang SC;
      font-weight: 600;
      line-height: 40px;
      color: #161616;
      .tips {
        font-size: 12px;
        color: #161616;
      }
    }
    .img {
      img {
        width: 40px;
        height: 40px;
        vertical-align: middle;
      }
    }
    .grey {
      // height: 17px;
      // font-size: 12px;
      font-family: PingFang SC;
      font-weight: 400;

      color: #a0a0a0;
    }
    .recommend {
      text-align:center;
      color: #53CDDC;
      font-size: 20px;
    }
  }
}
</style>
